<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
	<style type="text/css">
			#rows{
			margin:20px;
			font-size: 16px;
			}
		</style>
<script type="text/javascript">
 function doEdit(){
var id=${object.id};
var pstate=$("#pstate").val();
		Kit.confirm("提示","确定修改商品状态吗？",function(ref){
			$.post("${BASE_PATH}/bus/goods/store/edit",{id:id,pstate:pstate},function(result){
				if(result.flag==0){
					Kit.alert("操作成功");
					onEditSuccess(result.object);
					editDialog.close();
				}else{
					Kit.alert("操作失败");return;
				}
				
			});
		});
 }
   $(document).ready(function() {
     $(".radioItem").change(function() {
         var $selectedvalue = $("input[name='state']:checked").val();
         if ($selectedvalue == 1) {
        	 $("input[name=pstate]").val(1);
         }else if($selectedvalue == 2){
        	 $("input[name=pstate]").val(2);
         }else{
        	 $("input[name=pstate]").val(3);
         }
     });
 }); 
</script>
 <div >
	<div class="row" id="rows">
	    <label class="text-label">商品名称：</label>
	    <div class="text-content">${object.name}</div>
	</div>
	<div class="row" id="rows">
	    <label class="text-label">商品状态：</label>
	    	<input hidden="hidden" type="text" id="pstate" name="pstate" value="${object.pstate}"/>
	 	<div class="text-content">
		 		正常 :&nbsp;&nbsp;
		 	<input type="radio" disabled class="radioItem" id="state1" name="state" value="1" <c:if test="${object.pstate ==1 }">checked="checked"</c:if>/>
		 		&nbsp;&nbsp;售罄 :&nbsp;&nbsp;
		 	<input type="radio" class="radioItem" id="state2" name="state" value="2" <c:if test="${object.pstate ==2 }">checked="checked"</c:if>/>
			<%-- 	&nbsp;&nbsp; 降权 :&nbsp;&nbsp;
			<input type="radio" class="radioItem" id="state3" name="state" value="3" <c:if test="${object.pstate ==3 }">checked="checked"</c:if>/> --%>
		</div>
	</div>
	<div class="row" id="rows">
		<div class="col-lg-6"><button class="btn btn-primary col-sm-3 pull-right" type="submit" onclick="doEdit();">提交</button></div>
		<div class="col-lg-6"><button class="btn btn-default col-sm-3 pull-left"  type="button" onclick="javascript:editDialog.close();" autocomplete="off">取消</button></div>
	</div>
</div>